import * as THREE from 'three';
import { loadGltfAndCreateInstanceMeshWithMatrixWorld } from '../three-utils';

/**
 * 加载风力发电机
 * @returns
 */
export const loadWindTurbine = (): Promise<THREE.InstancedMesh | null> => {
  const matrixWorldArray = [
    [
      0.0008536092336916995, 0, -0.0000664422016599629, 0, 0, 0.0008561912109144032, 0, 0,
      0.0000664422016599629, 0, 0.0008536092336916995, 0, 0.8598856925964355, 0.6587164402008057,
      -8.620080947875977, 1,
    ],
    [
      0.0008536092336916995, 0, -0.0000664422016599629, 0, 0, 0.0008561912109144032, 0, 0,
      0.0000664422016599629, 0, 0.0008536092336916995, 0, 3.830235004425049, 0.4864753186702728,
      -9.51188850402832, 1,
    ],
    [
      0.0008178115948277981, 0, 0.00025347127840848194, 0, 0, 0.0008561912109144032, 0, 0,
      -0.00025347127840848194, 0, 0.0008178115948277981, 0, 7.466055393218994, 0.321126788854599,
      -9.172553062438965, 1,
    ],
    [
      0.0008140583341796256, 0, 0.00026527820583813915, 0, 0, 0.0008561912109144032, 0, 0,
      -0.00026527820583813915, 0, 0.0008140583341796256, 0, -0.8711234927177429, 0.9360381364822388,
      -9.609651565551758, 1,
    ],
    [
      0.0005731255915787175, 0, 0.0006360743302740034, 0, 0, 0.0008561912109144032, 0, 0,
      -0.0006360743302740034, 0, 0.0005731255915787175, 0, -5.079350471496582, 0.6293827295303345,
      -8.76380729675293, 1,
    ],
    [
      0.0007831247470521562, 0, 0.00034609106771254394, 0, 0, 0.0008561912109144032, 0, 0,
      -0.00034609106771254394, 0, 0.0007831247470521562, 0, 0.10236471891403198,
      0.40800920128822327, -7.662586688995361, 1,
    ],
    [
      0.0007831247470521562, 0, 0.00034609106771254394, 0, 0, 0.0008561912109144032, 0, 0,
      -0.00034609106771254394, 0, 0.0007831247470521562, 0, -3.9721553325653076,
      0.15639278292655945, -7.252913475036621, 1,
    ],
    [
      0.000856185891499018, 0, -0.0000030180910191513534, 0, 0, 0.0008561912109144032, 0, 0,
      0.0000030180910191513534, 0, 0.000856185891499018, 0, -1.3547430038452148,
      0.07599970698356628, -6.7178215980529785, 1,
    ],
    [
      0.000856185891499018, 0, -0.0000030180910191513534, 0, 0, 0.0008561912109144032, 0, 0,
      0.0000030180910191513534, 0, 0.000856185891499018, 0, 1.9726243019104004, 0.26853975653648376,
      -7.714597702026367, 1,
    ],
  ];

  return loadGltfAndCreateInstanceMeshWithMatrixWorld({
    modelPath: '/model/wind-turbine/model.glb',
    matrixWorldArray,
  });
};
